package com.cn.scenario.util.managethread;

import com.cn.scenario.service.AppUserService;
import org.redisson.api.RBloomFilter;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author Boolean
 * @Date 2022/12/24 11:34
 * @Version 1.0
 */
@Component
public class RefreshBloomThread {

    @Resource
    private AppUserService appUserService;

    public static RefreshBloomThread refreshBloomThread;

    static RBloomFilter<String> bloomFilterAppUser;

    @PostConstruct
    public void init() {
        refreshBloomThread = this;
        refreshBloomThread.appUserService = this.appUserService;
    }


    /**
     * @description: 废弃
     * @author: 任秀兴
     * @date: 2022/12/28 14:51
     * @param: []
     * @return: void
     **/
    public static void refreshBloomThread(){
        //创建使用固定线程数的线程池
        ExecutorService executorService = Executors.newFixedThreadPool(1);

        for (int i = 0; i < 1; i++) {
            executorService.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName() + "正在执行任务");
                }
            });
        }
    }

}
